package com.lantosec.hmrp.modules.revisit.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import java.util.Date;

import com.lantosec.hmrp.core.mvc.BaseEntity;
import com.lantosec.hmrp.modules.revisit.vo.RevisitTaskVO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * <p>
 * 回访任务 实体类
 * </p>
 *
 * @author AutoCode
 * @since 2020-04-28
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class RevisitTask extends BaseEntity<RevisitTaskVO> {

    private static final long serialVersionUID = 1L;
    public RevisitTask(RevisitTaskVO vo){
        this.revisitTaskId = vo.getRevisitTaskId();
        this.deptId = vo.getDeptId();
        this.userId = vo.getUserId();
        this.patientId = vo.getPatientId();
        this.outTime = vo.getOutTime();
        this.revisitTimeStd = vo.getRevisitTimeStd();
        this.doctorState = vo.getDoctorState();
        this.nurseState = vo.getNurseState();
    }

    @Override
    public RevisitTaskVO convertToVO(){
        return new RevisitTaskVO(this);
    }


    /**
     * 回访任务ID
     */
    @TableId(value = "revisit_task_id", type = IdType.AUTO)
    private Integer revisitTaskId;

    /**
     * 出院科室ID
     */
    private String deptId;

    /**
     * 主管医生ID
     */
    private String userId;

    /**
     * 患者ID
     */
    private String patientId;

    /**
     * 出院时间
     */
    private Date outTime;

    /**
     * 回访时间期限
     */
    private String revisitTimeStd;

    /**
     * 主管医生回访状态(0待回访 1已回访 2超时回访)
     */
    private Integer doctorState;

    /**
     * 护士回访状态(0待回访 1已回访 2超时回访)
     */
    private Integer nurseState;


    public enum ColName {
        revisit_task_id, dept_id, user_id, patient_id, out_time, revisit_time_std, doctor_state, nurse_state,
    }
}
